/** 管理路由 */
import Layout from '@/views/layout/customerLayout'


/**
 * 客户
 */
const Router1 = {
	path: '/customer',
	meta: {
		title: '客户管理',
		icon: 'customer',
		requiresAuth: true,
		index: 0,
		type: 'customer',
		subType: 'index'
	},
	children: [
		{
			path: 'index', 
			component: () => import('@/views/customer/index'),
			meta: {
				requiresAuth: true,
				title: '正在跟进',
				icon: 'customer',
				index: 1,
				type: 'customer',
				subType: 'index'
			}
		},
		{
			path: 'nocharge', 
			component: () => import('@/views/customer/nocharge'),
			meta: {
				requiresAuth: true,
				title: '面谈未收费',
				icon: 'customer',
				index: 1,
				type: 'customer',
				subType: 'nocharge'
			}
		},
		{
			path: 'charge', 
			component: () => import('@/views/customer/charge'),
			meta: {
				requiresAuth: true,
				title: '面谈已收费',
				icon: 'customer',
				index: 1,
				type: 'customer',
				subType: 'charge'
			}
		}
		
	]
}

const Router31 = {
	path: '/customer',
	component: Layout,
	redirect: '/customer/index',
	name: 'customer',
	hidden: true,
	meta: {
		requiresAuth: true,
		title: '客户管理',
		index: 0,
		type: 'customer'
	},
	children: [
		{
			path: 'pool', 
			component: () => import('@/views/customer/pool'),
			meta: {
				requiresAuth: true,
				title: '公海池',
				icon: 'seas',
				index: 1,
				type: 'customer',
				subType: 'pool'
			}
		},
		{
			path: 'contacts', 
			component: () => import('@/views/customer/contacts'),
			meta: {
				requiresAuth: true,
				title: '联系人',
				icon: 'contacts',
				index: 1,
				type: 'customer',
				subType: 'contacts'
			}
		},
		{
			path: 'logs', 
			component: () => import('@/views/customer/logs'),
			meta: {
				requiresAuth: true,
				title: '跟进日志',
				icon: 'log',
				index: 1,
				type: 'customer',
				subType: 'logs'
			}
		}
  ]
}

const Router32 = {
	path: '/customer',
	component: Layout,
	redirect: '/customer/index',
	name: 'customer',
	hidden: true,
	meta: {
		requiresAuth: true,
		title: '客户管理',
		index: 0,
		type: 'customer'
	},
	children: [
		{
			path: 'statistics', 
			component: () => import('@/views/customer/statistics/index'),
			meta: {
				requiresAuth: true,
				title: '统计',
				icon: 'relevance',
				index: 1,
				type: 'customer',
				subType: 'statistics',
				num: 0
			}
		},
		{
			path: 'read/:id', 
			name:"read",
			component: () => import('@/views/customer/read/index'),
			hidden:true,
			meta: {
				requiresAuth: true,
				title: '客户详情',
				index: 1,
				type: 'customer',
				subType: 'read'
			}
		}
  ]
}

const Router = {
	path: '/customer',
	component: Layout,
	redirect: '/customer/index',
	name: 'customer',
	hidden: true,
	meta: {
		requiresAuth: true,
		title: '客户管理',
		index: 0,
		type: 'customer'
	},
	children: [
		...Router1.children,
		...Router31.children,
		...Router32.children
	]
}

export default Router

export const managerRouterMenu = [
	// Router1,
	// ...Router31.children,
	// ...Router32.children
	...Router1.children,
	...Router31.children,
	...Router32.children
]